package com.qk.management.mapper;
import com.qk.domain.user.UserDO;
import com.qk.dto.user.UserDTO;
import com.qk.entity.User;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author: 20918
 * @date: 2025/10/7 18:16
 * @description:
 */
@Mapper
public interface UserMapper {
    List<UserDO> list(UserDTO userDTO);

    void insert(User user);

    @Select("select * from user where id = #{id}")
    User selectById(Integer id);

    void update(User user);

    void deleteByIds(List<Integer> ids);

    @Select("select * from user where username = #{username}")
    User selectByUsername(String username);

    @Select("select * from user")
    List<User> all();

    @Select("select * from user where role_id = #{id}")
    List<User> listOfRole(Integer id);

    @Select("select * from user where dept_id =#{deptId}")
    List<User> listOfDept(Integer deptId);
}
